home *** CD-ROM | disk | FTP | other *** search
/ The CICA Windows Explosion! / The CICA Windows Explosion! - Disc 2.iso / pdoxwin / pi0495.zip / LW9504.EXE / easter.txt < prev    next >
Text File  |  1995-01-20  |  2KB  |  70 lines

  1. METHOD pushButton(VAR eventInfo Event)
  2. VAR
  3.         easter_year            Number
  4.         easter_month           String
  5.         easter_sunday          Number
  6.         golden_number          Number
  7.         century                Number
  8.         leap_year_correction   Number
  9.         lunar_correction       Number
  10.         sunday                 Number
  11.         epact                  Number
  12.         full_moon              Number
  13.     dummy           Table
  14.     easter_table    TCursor
  15. ENDVAR
  16.     dummy = create "easter2.db"
  17.                 with
  18.                     "Year"  :   "S",
  19.                     "Month" :   "A5",
  20.                     "Day"   :   "S"
  21.                 key "Year"
  22.             endcreate
  23.     easter_table.open("easter2.db")
  24.     easter_table.edit()
  25.     FOR easter_year FROM FirstYear TO LastYear
  26.         sleep()
  27.         golden_number = MOD(easter_year, 19)
  28.                             + 1
  29. century = FLOOR(easter_year/100) + 1
  30. leap_year_correction
  31.     = FLOOR(3*century/4) - 12
  32. lunar_correction
  33.     = FLOOR((8*century+5)/25) - 5
  34. sunday = FLOOR(5*easter_year/4)
  35.             - leap_year_correction
  36.             - 10
  37. epact = MOD(11*golden_number + 20
  38.             + lunar_correction
  39.             - leap_year_correction,
  40.             30)
  41. IF (epact = 25 AND golden_number > 11)
  42.     OR (epact = 24)
  43. THEN
  44.     epact = epact + 1
  45. ENDIF
  46. full_moon = 44 - epact
  47. IF full_moon < 21
  48. THEN
  49.     full_moon = full_moon + 30
  50. ENDIF
  51. easter_sunday = full_moon + 7
  52.     - MOD(sunday + full_moon, 7)
  53. IF easter_sunday > 31
  54. THEN
  55.     easter_sunday
  56.         = easter_sunday - 31
  57.     easter_month = "April"
  58. ELSE
  59.     easter_month = "March"
  60. ENDIF
  61.         sleep()
  62.         easter_table.insertRecord()
  63.         easter_table."Year"  = easter_year
  64.         easter_table."Month" = easter_month
  65.         easter_table."Day"   = easter_sunday
  66.     ENDFOR
  67. sleep()
  68. easter_table.close()
  69. ENDMETHOD
  70.